﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03SequenceMinMax
{
    class _03SequenceMinMax
    {
        static void Main(string[] args)
        {
            Console.Write("How many numbers to compare?");
            string amountStr = Console.ReadLine();
            int amount = int.Parse(amountStr);
            Console.Write("Enter number:");
            string numberStr = Console.ReadLine();
            int entry = int.Parse(numberStr);
            int counter = 2;
            int max, min;
            max = entry;
            min = entry;
            while (counter <= amount)
            {
                Console.Write("Enter number:");
                string entryStr = Console.ReadLine();
                entry = int.Parse(entryStr);
                if (entry < min)
                {
                    min = entry;
                }
                else if (entry > max)
                {
                    max = entry;
                }
                counter++;
            }
            Console.WriteLine("The biggest number is {0} and the smallest number is {1}.", max, min);
            Console.ReadLine();
        }
    }
}
